package com.ly.drivingschool.config;


import com.ly.drivingschool.util.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @version 1.0
 */
@Configuration
public class WebConfigurer implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        System.out.println("拦截器配置");
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**").excludePathPatterns("/adminView/login.html")
                .excludePathPatterns("/test")
                .excludePathPatterns("/admin/login")
                .excludePathPatterns("/adminView/css/**")
                .excludePathPatterns("/adminView/img/**")
                .excludePathPatterns("/adminView/jquery/**")
                .excludePathPatterns("/adminView/js/**")
                .excludePathPatterns("/wxApi/**")
                .excludePathPatterns("/setmeal/**")
                .excludePathPatterns("/order/**")
                .excludePathPatterns("/tweet/**");
    }
}
